
        var totalno;
        var index;
        var value;
        
        function search(){
        
            index=document.getElementById("v_index").value;
            value=encodeURI(document.getElementById("v_value").value);
            pageSelect(1); 
        }
        
      
       function pageselectCallback(page_index){
             pageSelect(page_index+1);
      }
     
 
      function initPagination() {

          $("#Pagination").pagination(totalno, {
              callback: pageselectCallback,
              items_per_page:10// Show only one item per page
          });
       }
       
       
       
   function addExpress(linkmetatable,linkmetaid,recordno){
	
			location.href="Reader-Access.jsp?destPage=/MyLibrary/newbook.jsp?catname="+encodeURI('深图新书选购目录')+"&local=2Z&library=044005";
	
}
       
  
      function Check(t,linkmetatable,linkmetaid,bookrecordno,a) {
     	  $.ajax({  
		          url: 'proxyBasic.jsp?requestmanage/recommendCheck?linkmetatable='+linkmetatable+'&linkmetaid='+linkmetaid+'&library=044005&local=2Z&bookrecordno='+bookrecordno,
		          type: 'GET',   
		          timeout: 10000,  
		          cache: false,  
		          dataType : "json",//数据类型为jsonp   
		        //jsonp: "callback",//服务端用于接收callback调用的function名的参数   只在跨域时配置，
		
		          success: function(json){
		        
		             var message=json.message;
	
		             if(message=="ok"){
		 		             if(a=="1"){
				                 location.href="Reader-Access.jsp?destPage=/MyLibrary/ReserveSubmit.jsp?v_Tableid="+linkmetatable+"&v_recno="+linkmetaid+"&doclibrary=044005&local=2Z&bookrecordno="+bookrecordno;
				            }else if(a=="2"){
				            
				               addExpress(linkmetatable,linkmetaid,bookrecordno);
				            }
			          }else{
			                
			               if(message=="本书数量已达上限，请您挑选其他图书。"){
			       
			              	   // $(t).parent().hide();

			   	       	     $(t).parent().find("div").last().html("<span style='color:red'> "+message+"</span>");
			               }
			           		showdialogbox(message,"2");
                      }
                
			    }
	   });
    }
      
 
 
 
 
   function pageSelect(page) {
     var m="";
     if(index !=null && value !=null && value!="")
          m="&v_index="+index+"&v_value="+value;
    
//alert('proxyBasic.jsp?requestmanage/getNBbyIndex?pageIndex='+page+'&pageSize=10'+m+'&library=044005&local=2Z'+'&catname='+encodeURI('深图新书选购目录'));
    	  $.ajax({  
		     url: 'proxyBasic.jsp?requestmanage/getNBbyIndex?pageIndex='+page+'&pageSize=10'+m+'&library=044005&local=2Z'+'&catname='+encodeURI('深图新书选购目录'),
			
				type: 'GET',   
		      timeout: 10000,  
		      cache: false,  
		      dataType : "json",//数据类型为jsonp   
		
		      //jsonp: "callback",//服务端用于接收callback调用的function名的参数   只在跨域时配置，
		
		      success: function(json){
//alert(11)
		            totalno=json.totalno;
			          // alert(totalno);
	              var booklist=json.result;
				    var strss="";		
				    var catname=json.catname;
				    var library=json.library;
				    var local=json.local;
				    	     
		             for(var i=0;i<booklist.length;i++){
		             
		                    var title=booklist[i].title;
		                    var author=booklist[i].author;
		                    var publisher=booklist[i].publisher.split(",")[0];
		                    var date=booklist[i].publisher.split(",")[1];
		                    var abstract=booklist[i].abstract;
		                    var isbn=booklist[i].isbn;
		                    var price=booklist[i].price;
		                     //  var metaid=803041;
		                     var biblisomtableid=booklist[i].biblisomtableid;
		                     var biblisommetaid=booklist[i].biblisommetaid;
		                     var ordcatamid=booklist[i].ordcatamid;
		                      
		                     
		                     
				             strss+=" <li name='linkmetatable="+biblisomtableid+"&linkmetaid="+biblisommetaid+"&bookrecordno="+ordcatamid+"'>";
							 strss+=" <a><img class='img' src='https://www.references.com.cn/index.php?client=szlib&isbn="+isbn+"/cover' width='90' height='120'></a>";
							 strss+=" <h3 class='title'>"+title+"</h3>";
							 strss+=" <div class='info'>";
							 strss+=" <span class='author'>作 者："+author+"</span>";
							 strss+=" <span class='dates'>价格："+price+"</span>";
							 strss+=" <span class='publisher'>出版者："+publisher+"</span>";
							 strss+=" <span class='dates'>出版年："+date+"</span>";
						
							 strss+=" </div>";
							 strss+=" <div class='text'>";
							 strss+= abstract;
					         strss+=" </div>";
					         
					  //       str+="<a href='javascript:void(0)' onclick='cancelExpressBill("+expressBillNo+","+ExpressBillItemCount+");'  id='cancel'  style='border:1px #2ea6eb solid;background:url(images/totalbtn_bg2.png) repeat-x 0 0;'>取消订单</a>";
					         
		          	        strss+="<div > <a  href='javascript:void(0)' onclick='Check(this,"+biblisomtableid+","+biblisommetaid+","+ordcatamid+",1);'   class='btn_2' >读者自取</a>";
		          	      
							strss+=" <a href='javascript:void(0)' onclick='Check(this,"+biblisomtableid+","+biblisommetaid+","+ordcatamid+",2);' class='see'>加入快递书车</a></div>";
						//	strss+=" <a  href='newbookcart.jsp'   class='btn_2' >进入书车</a>";
						    strss+=" </li>";
						  
		             }
		         //    alert(strss);
		                  $("#booklist").html(strss);
		                  
		               if(page==1){
		                  initPagination();
		                }
		               
		               
		              
			       		$('.booklist li').each(function(index,ele){
			       			var value=$(ele).attr("name");
                        
			       			$.ajax({  
					      		  
					             url: 	'proxyBasic.jsp?requestmanage/recommendCheck?'+value+'&library=044005&local=2Z',
					             type: 'GET',   
							     timeout: 10000,  
							     cache: false,  
							     dataType : "json",//数据类型为jsonp   
							        //jsonp: "callback",//服务端用于接收callback调用的function名的参数   只在跨域时配置，
							
							          success: function(json){
							  
							             var message=json.message;
							           
							             if(message=="本书数量已达上限，请您挑选其他图书。"){
							            	
							           	     //  $(".booklist li:eq("+index+")").hide();
							           
							           	       
							       	    $(".booklist li:eq("+index+")").find("div").last().html("<span style='color:red'> "+message+"</span>");
								
							             }
								    }
						   });//ajax
						    
			    });//each
		               
		               
		               

		               
		            
		               
		    }//success结束
		});
   
 }
 

   
   $(function(){
	   
		$('.seltypelist li').each(function(i){//分类栏目
			
				$(this).click(function(){
					
						            index="classno";
							    	$('.seltypelist li').eq(i).addClass('blue2').siblings().removeClass('blue2');
									$('.seltypelist li').eq(i).parent().siblings("ul").children("li").removeClass('blue2');
								    value=$('.seltypelist li').eq(i).children("a").attr("value");
							     	pageSelect(1); 
							     	
							});
		}).focus(function(){this.blur();});
		
  });
   
   
   
 $(document).ready(function(){    
	             pageSelect(1);
		
});   
            
